package com.gupaoedu.design.adapter;

/**
 * <p></p>
 *
 * @author Andy
 * @date 2018/3/15.
 */
public class SignForThirdAdapter {
    private SigninService service = new SigninServiceImpl();

    public SignForThirdAdapter() {
    }

    public ResultMsg loginForQQ(String openId) {
        //在不影响之前的系统，openId是唯一的id
        //将这个openId存入User表当中，把openId当作username
        return loginForRegister(openId, null);
    }

    public ResultMsg loginForWeChat(String openId) {
        return null;
    }

    public ResultMsg loginForTokent(String tokent) {
        return null;
    }

    public ResultMsg loginForRegister(String username, String password) {
        service.register(username, password);
        return service.login(username, password);
    }
}
